package com.situ.mall.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.situ.mall.pojo.entity.user.Address;
import com.situ.mall.user.mapper.AddressMapper;
import com.situ.mall.user.service.IAddressService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 用户地址表 服务实现类
 * </p>
 *
 * @author Sun Huijuan
 * @since 2024-10-14
 */
@Service
public class AddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements IAddressService {
	@Autowired
	private AddressMapper addressMapper;
	
	@Override
	public List<Address> selectByUserId(Integer id) {
		QueryWrapper<Address> queryWrapper = new QueryWrapper<>();
		queryWrapper.eq("user_id", id);
		return addressMapper.selectList(queryWrapper);
	}
}
